With the recent progress in miniaturization technology for semiconductor device manufacturing, the patterns formed on a semiconductor wafer have been miniaturized, and increasingly higher accuracy is required for apparatuses that evaluate the miniaturized patterns. Particularly, the advance in OPC (Optical Proximity Correction) technology has created increasing demand for evaluating the two-dimensional shape of a pattern. In order to accurately measure or inspect a fine pattern, a charged particle beam apparatus represented by the scanning electron microscope (SEM) is used. In an image acquired by a SEM and the like, a pattern edge portion is represented with a certain width. As a method for accurately ascertaining the edge shape of a pattern, an edge line determination technology is known. Patent Literatures 1 and 2 disclose methods for performing pattern matching between an edge line and design data so as to accurately measure a shape difference between design data and edge line.